package com.example.command;

/**
 * 命令模式 Command
 */
public class AppTest {
    public static void main(String[] args) {
        // 股票
        Stock stock = new Stock("stock-b", 3);
        BuyOrder buyOrder = new BuyOrder(stock);
        SellOrder sellOrder = new SellOrder(stock);

        // 经理人
        Broker broker = new Broker();
        broker.takeOrder(buyOrder);
        broker.takeOrder(sellOrder);

        broker.placeOrder();
        // output:
        //     Bought 3 stock-b
        //     Sold 3 stock-b
    }
}
